# -*-coding:utf-8 -*-
from __future__ import unicode_literals

from django import forms
from captcha.fields import CaptchaField


# form可生成html字段代码, 也可验证字段合法性
class RegisterForm(forms.Form):
	email = forms.EmailField(required=True)
	password = forms.CharField(required=True, min_length=5, max_length=21)
	captcha = CaptchaField(error_messages={'invalid': u'验证码错误'})  # 可自定义错误信息


class ForgetPwdForm(forms.Form):
	email = forms.EmailField(required=True)
	captcha = CaptchaField(error_messages={'invalid': u'验证码错误'})

class ModifyPwdForm(forms.Form):
	password = forms.CharField(required=True, min_length=5)
	password2 = forms.CharField(required=True, min_length=5)


class LoginForm(forms.Form):
	username = forms.CharField(required=True)
	password = forms.CharField(required=True, min_length=5)
